;(function(){
    const template=`<div class="row placeholders">
    <div v-for="(hobit,index) in hobbies" :key="index" class="col-xs-6 col-sm-3 placeholder">
      <img src="" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
      <h4>{{hobit}}</h4>
      <a href="#" @click="deleteHobby(index)">删除</a>
    </div>
  </div>`
    window.Dashboard={
        template:template,
        //声明当前子组件接收父组件的属性
        props:["hobbies"],
        methods: {
          deleteHobby(index){
            //通过事件去调用父组件的函数，并向父组件发送消息(数据)
            this.$emit("delete_hobby",index);
          }
        },
    }
})()